package tpenchere.ui.contents;

import java.util.Date;
import java.util.List;

import javax.swing.JMenuBar;
import javax.swing.JToolBar;

import org.jdesktop.application.ResourceMap;
import org.jdesktop.swingx.JXDatePicker;

import tpenchere.application.MainApplication;
import tpenchere.controllers.BidController;
import tpenchere.controllers.BidHistoryController;
import tpenchere.controllers.ControllerInterface;
import tpenchere.ui.AbstractView;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JFormattedTextField;
import java.awt.ComponentOrientation;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextPane;
import javax.swing.JTextArea;

public class BidHistoryWindow extends AbstractView {
	private final ResourceMap resourceMap = MainApplication.getApplication().getContext().getResourceMap(this.getClass());
	private BidHistoryController controller;
	private JTextArea log;
	
	public BidHistoryWindow() {
		controller = new BidHistoryController(this);
		setLayout(new BorderLayout(0, 0));
		
		log = new JTextArea();
		log.setRows(5);
		add(log, BorderLayout.CENTER);
		
		JButton btnClose = new JButton(controller.getActionMap().get("view.bid.button.cancel"));
		add(btnClose, BorderLayout.SOUTH);
		
		JLabel lblBidLog = new JLabel("Bid log");
		add(lblBidLog, BorderLayout.NORTH);
	}

	@Override
	public ControllerInterface getController() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public JMenuBar getMenuBar() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<JToolBar> getToolbars() {
		// TODO Auto-generated method stub
		return null;
	}
	
	public JTextArea getLog() {
		return log;
	}

	public void setLog(JTextArea log) {
		this.log = log;
	}

	public void updateView() {
		controller.loadLog();
	}
	
	public void updateView(Object args) {
		controller.setProductId((Integer)args);
		controller.loadLog();
	}
}
